<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
	<title>事务设置</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	
	<script type="text/javascript" src="<%= basePath %>assets/js/js.js"></script>
	<script type="text/javascript" src="<%= basePath %>assets/js/jquery-1.8.1.min.js"></script>
	<script type="text/javascript" src="<%= basePath %>assets/js/bui-min.js"></script>
	<script type="text/javascript" src="<%= basePath %>assets/js/config-min.js"></script>
	<script src="http://g.tbcdn.cn/fi/bui/jquery-1.8.1.min.js"></script>
	<script src="http://g.alicdn.com/bui/seajs/2.3.0/sea.js"></script>
	<script src="http://g.alicdn.com/bui/bui/1.1.21/config.js"></script>
	
	<link href="http://g.alicdn.com/bui/bui/1.1.21/css/bs3/dpl.css" rel="stylesheet">
	<link href="http://g.alicdn.com/bui/bui/1.1.21/css/bs3/bui.css" rel="stylesheet">
	
	<script type="text/javascript">
		BUI.use('common/page');
	</script>
	
	<script type="text/javascript">
		BUI.use('bui/form',function (Form) {
		  new Form.Form({
		    srcNode : '#J_Form'
		  }).render();
		});
	</script>
	
	<style type="text/css">
		body {
			text-align: center;
			padding: 20px 50px 20px 30px;
		}
		
		.doc-content {
			width: 100%;
		}
		
		.form-panel {
			width: 100%;
		}
		
		.panel-content, .table th {
			background: #D9EDF7;
		}
		
		.panel-content>li>button, .panel-content>li>a {
			font-size: 12px;
			letter-spacing: 2px;
			margin-left: 20px;
		}
		
		.table td, .table th {
			text-align: center;
		}
		
		.table a {
			color: #222;
			margin: 0 10px;
		}
	</style>
</head>
<body>
	<div class="span24 doc-content">
		<form class="form-panel" method="post"
			action="<%= basePath %>transdetail/listTransDetail">
			<ul class="panel-content">
				<li>
					<label class="control-label">事务明细：</label> 
					<input name="transDetailName" style="width:180px;" 
						placeholder="事务明细名称..." type="text"
						value='<s:property value="#transDetailName"/>'>
					
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					
					<label class="control-label">事务种类：</label>
					<input name="transTypeName" style="width:180px;" 
						placeholder="事务种类名称..." type="text"
						value="<s:property value="#transTypeName"/>">
					
					<!-- 查询按钮 -->
					<button class="button button-default">查询</button> 
					
					<a href="<%=basePath%>transdetail/initadd" class="button button-info">添加事务明细</a>
					<a href="<%=basePath%>transtype/listTransType" class="button button-info">设置事务类型</a>
				</li>
			</ul>
		</form>
		
		<table class="table table-bordered">
			<thead>
				<tr>
					<th>事务明细</th>
					<th>事务种类</th>
					<th>初审时限(小时)</th>
					<th>响应时限(小时)</th>
					<th>解决时限(小时)</th>
					<th>操作</th>
				</tr>
			</thead>
			<!-- 迭代输出数据 -->
			<tbody>
				<s:iterator value="#pageInfo.basePageList" var="transDetail">
					<tr>
						<td><s:property value="#transDetail.tdname"/></td>
						<td><s:property value="#transDetail.ttname"/></td>
						<td><s:property value="#transDetail.examtime"/></td>
						<td><s:property value="#transDetail.servicetime"/></td>
						<td><s:property value="#transDetail.endtime"/></td>
						<td>
							<!-- 修改按钮 -->
							<a href="<%=basePath%>transdetail/initModify?transDetail.tdid=<s:property value="#transDetail.tdid"/>" 
								class="update button" style="border: 0px;">
								<i class="icon-black icon-edit"></i>
							</a>
							
							<!-- 删除按钮 -->
							<a href="<%=basePath%>transdetail/deleteTransDetail?transDetail.tdid=<s:property value="#transDetail.tdid"/>" 
								class="delete button" style="border: 0px;">
								<i class="icon-black icon-trash"></i>
							</a>
						</td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
		
		<!-- 分页工具条 -->
		<div>
			<div class="pagination pull-right" style="margin-top: 30px;">
				<ul>
					<!-- 显示总记录数和总页数 -->
					<li class="disabled" style="letter-spacing: 2px;">
						<a href="">
							总共<s:property value="#pageInfo.rootListSize" />条/
							<s:property value="#pageInfo.pageCount" />页
						</a>
					</li>

					<!-- 是否要上一页按钮 -->
					<s:if test="#pageInfo.nowPage > 1">
						<li class="active">
							<a href="<%= basePath %>transdetail/listTransDetail?targetPage=<s:property value="#pageInfo.nowPage - 1"/>&transDetailName=<s:property value="#transDetailName"/>&transTypeName=<s:property value="#transTypeName"/>">
								«上一页
							</a>
						</li>
					</s:if>
					<s:else>
						<li class="disable">
							<a href="">« 上一页</a>
						</li>
					</s:else>

					<!-- 迭代输出每一页的页号 -->
					<s:iterator value="#pageInfo.pageNoList" var="page">
						<!-- 首先确保不是-1 -->
						<s:if test="#page != -1">
							<s:if test="#page != 0">
								<!-- 如果是当前页，特殊颜色显示 -->
								<s:if test="#page == #pageInfo.nowPage">
									<li class="active">
										<a href="<%= basePath %>transdetail/listTransDetail?targetPage=<s:property value="#page"/>&transDetailName=<s:property value="#transDetailName"/>&transTypeName=<s:property value="#transTypeName"/>">
											<s:property value="#page" />
										</a>
									</li>
								</s:if>

								<!-- 否则一般颜色显示 -->
								<s:else>
									<li>
										<a href="<%= basePath %>transdetail/listTransDetail?targetPage=<s:property value="#page"/>&transDetailName=<s:property value="#transDetailName"/>&transTypeName=<s:property value="#transTypeName"/>">
											<s:property value="#page" />
										</a>
									</li>
								</s:else>
							</s:if>
							<s:else>
								<li>
									<a href="<%= basePath %>transdetail/listTransDetail?targetPage=1&transDetailName=<s:property value="#transDetailName"/>&transTypeName=<s:property value="#transTypeName"/>">...</a>
								</li>
							</s:else>
						</s:if>
					</s:iterator>

					<!-- 是否需要最后一页的按钮 -->
					<s:if test="#pageInfo.pageCount == #pageInfo.nowPage">
						<li class="disable">
							<a href="">下一页 »</a>
						</li>
					</s:if>
					<s:else>
						<li class="active">
							<a href="<%= basePath %>transdetail/listTransDetail?targetPage=<s:property value="#pageInfo.nowPage + 1"/>&transDetailName=<s:property value="#transDetailName"/>&transTypeName=<s:property value="#transTypeName"/>">
							下一页»
							</a>
						</li>
					</s:else>
				</ul>
			</div>
		</div>
	</div>

	<!-- 删除script -->
	<script type="text/javascript">
      var href="";
        BUI.use('bui/overlay',function(Overlay){
          var dialog = new Overlay.Dialog({
            title:'确认框 ',
            width:300,
            height:200,
            bodyContent:'<p>是否确认删除  ？ </p>',
            success:function () {
            	window.location.href = href;
            }
          });
        
        $('.delete').on('click',function (e) {
        	e.preventDefault();
        	href=this.href;
        	console.log(href)
            dialog.show();
        });
        
    	$('.update').on('click',function () {
        	var href = this.href;
			window.location.href = href;
        });
    });
  </script>

</body>
</html>
